<?php 
include 'D:/dingjiangbbs/common/home.php';
//屏蔽notice错误
error_reporting(E_ALL ^ E_NOTICE);

/***************置顶，精华，高亮******************/
//获取帖子id,并传给个人主页
//var_dump($_GET); 
$id  = $_GET['id'];

//var_dump($classid);
//判断是否删除帖子
if (!$_GET['isdel']) {

	$isdel = $res[0]['isdel'];
}else {

	$isdel = 1;
}

//判断是否高亮
if (!$_GET['ishot']) {

	$ishot = $res[0]['ishot'];
}else {

	$ishot = 1;
}

//判断是否置顶
if (!$_GET['istop']) {

	$istop = $res[0]['istop'];
}else {

	$istop = 1;
}
if ($istop == 1) {

	$toptime = time();
}
//判断是否精华
if (!$_GET['elite']) {

	$elite = $res[0]['elite'];
}else {

	$elite = 1;
}

if ($elite == 1) {

	$style = 'red';
}else {

	$style = $res[0]['style'];
}
//修改数据库字段
$data = [
	'istop'   => $istop,
	'ishot'   => $ishot,
	'elite'   => $elite,
	'isdel'   => $isdel,
	'style'   => "$style",
	'toptime' => $toptime
];
$result = update($link,DB_TABLE_DETAIL,$data,"id=$id");
//var_dump($result);

//输出，跳转页面
echo '<a href="'.WEB_SITE.'personal.php?id='.$id.'">返回页面</a>';
/**************************************************/